import Vue from 'vue'
import Router from 'vue-router'
// import shop from '@/components/shop/shop.vue'
// const shop = () => import('@/views/shop/shop.vue')

const Layout = () => import('@/views/layout/')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/home',
      component: Layout,
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/home/')
        },
        {
          path: 'personal',
          name: 'personal',
          component: () => import('@/views/personal/')
        },
        {
          path: 'cart',
          name: 'cart',
          component: () => import('@/views/cart')
        },
        {
          path: 'trade',
          name: 'trade',
          component: () => import('@/views/trade')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/')
    },
    {
      path: '/signup',
      name: 'signup',
      component: () => import('@/views/signup/')
    },
    // {
    //   // 店铺主页，在这个项目中没有单独的店铺
    //   path: '/shop/:shopId',
    //   name: 'shop',
    //   component: shop
    // }
  ]
})
